package com.atguigu.gmall.feign.cart;

import com.atguigu.gmall.cart.entity.CartInfo;
import com.atguigu.gmall.cart.vo.SuccessCartVo;
import com.atguigu.gmall.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author:lyd
 * @Date:2023/9/1 18:15
 * @Version:1.0
 * @Description
 **/
@FeignClient("service-cart")
@RequestMapping("/api/inner/cart")
public interface CartFeignClient {

    /**
     * 向购物车中添加商品
     *
     * @param skuId
     * @param skuNum
     * @return
     */
    @GetMapping("/add/{skuId}/{skuNum}")
    Result<SuccessCartVo> add(@PathVariable Long skuId,
                              @PathVariable Integer skuNum);

    @GetMapping("/delete/checked")
    Result deleteChecked();


    /**
     * 获取购物车中选中的数据
     *
     * @return
     */
    @GetMapping("/checked")
    Result<List<CartInfo>> getChecked();
}
